// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v3.20.0
// source: protos/router.proto

package proto

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// RouterServiceClient is the client API for RouterService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type RouterServiceClient interface {
	ListRouters(ctx context.Context, in *ListRoutersRequest, opts ...grpc.CallOption) (*ListRoutersReply, error)
	AddRouter(ctx context.Context, in *AddRouterRequest, opts ...grpc.CallOption) (*AddRouterReply, error)
}

type routerServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewRouterServiceClient(cc grpc.ClientConnInterface) RouterServiceClient {
	return &routerServiceClient{cc}
}

func (c *routerServiceClient) ListRouters(ctx context.Context, in *ListRoutersRequest, opts ...grpc.CallOption) (*ListRoutersReply, error) {
	out := new(ListRoutersReply)
	err := c.cc.Invoke(ctx, "/spqr.RouterService/ListRouters", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *routerServiceClient) AddRouter(ctx context.Context, in *AddRouterRequest, opts ...grpc.CallOption) (*AddRouterReply, error) {
	out := new(AddRouterReply)
	err := c.cc.Invoke(ctx, "/spqr.RouterService/AddRouter", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// RouterServiceServer is the server API for RouterService service.
// All implementations must embed UnimplementedRouterServiceServer
// for forward compatibility
type RouterServiceServer interface {
	ListRouters(context.Context, *ListRoutersRequest) (*ListRoutersReply, error)
	AddRouter(context.Context, *AddRouterRequest) (*AddRouterReply, error)
	mustEmbedUnimplementedRouterServiceServer()
}

// UnimplementedRouterServiceServer must be embedded to have forward compatible implementations.
type UnimplementedRouterServiceServer struct {
}

func (UnimplementedRouterServiceServer) ListRouters(context.Context, *ListRoutersRequest) (*ListRoutersReply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListRouters not implemented")
}
func (UnimplementedRouterServiceServer) AddRouter(context.Context, *AddRouterRequest) (*AddRouterReply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AddRouter not implemented")
}
func (UnimplementedRouterServiceServer) mustEmbedUnimplementedRouterServiceServer() {}

// UnsafeRouterServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to RouterServiceServer will
// result in compilation errors.
type UnsafeRouterServiceServer interface {
	mustEmbedUnimplementedRouterServiceServer()
}

func RegisterRouterServiceServer(s grpc.ServiceRegistrar, srv RouterServiceServer) {
	s.RegisterService(&RouterService_ServiceDesc, srv)
}

func _RouterService_ListRouters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListRoutersRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RouterServiceServer).ListRouters(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/spqr.RouterService/ListRouters",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RouterServiceServer).ListRouters(ctx, req.(*ListRoutersRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RouterService_AddRouter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AddRouterRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RouterServiceServer).AddRouter(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/spqr.RouterService/AddRouter",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RouterServiceServer).AddRouter(ctx, req.(*AddRouterRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// RouterService_ServiceDesc is the grpc.ServiceDesc for RouterService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var RouterService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "spqr.RouterService",
	HandlerType: (*RouterServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListRouters",
			Handler:    _RouterService_ListRouters_Handler,
		},
		{
			MethodName: "AddRouter",
			Handler:    _RouterService_AddRouter_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "protos/router.proto",
}
